import java.awt.Toolkit;

import javax.swing.*;

import java.awt.event.*;


public class Window extends JFrame {
	
	
	public static void main(String[] args) {
		final PopupMenu popupMenu = new PopupMenu();
		JFrame frame = new JFrame("JPopupMenu");
	    Toolkit toolkit;
	    

    	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
    	toolkit = frame.getToolkit();
    	
		frame.addMouseListener(new MouseAdapter() {
	        public void mouseReleased(MouseEvent e) {
	            if (e.getButton() == e.BUTTON3) {
	            	popupMenu.menu.show(e.getComponent(), e.getX(), e.getY());
	            }
	        }
	    });

	    frame.setSize(250, 200);
	    frame.setLocationRelativeTo(null);
	    frame.setVisible(true);
		
		
	}

}
